#ifndef DELAYOPERATION_H
#define DELAYOPERATION_H
#include <QDebug>
#include <QTime>
#include <QTimer>
#include <QJsonObject>

#include "operation.h"

class DelayOperation : public Operation
{
    Q_OBJECT
public:
    explicit DelayOperation(QObject *parent = nullptr);

public:
    virtual void run() override;

private:
    int m_nDuration; //毫秒

public:
    int             GetDuration(){return m_nDuration;}

public:
    virtual Operation* clone(Operation* pOperation) override;
    virtual void writeXML(QXmlStreamWriter &writer) override;
    virtual void readFromXML(QXmlStreamReader &reader) override;

    virtual QString getClassName() override;

    int nDuration() const;
    void setNDuration(int newNDuration);
};

#endif // DELAYOPERATION_H
